// miniprogram/pages/yy/yy.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    prop: 87,
    propNumber:null
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    this.proportion()
  },

  //数据条方法
  proportion: function() {
    this.setData({
      propNumber:100- this.data.prop
    })
    var that = this
    let proportionTime=setInterval(function() {
      if (that.data.prop > that.data.propNumber) {
        that.setData({
          prop: that.data.prop -= 1
        })
      }else{
        clearInterval(proportionTime)
      console.log(that.data.prop)
      }
    }, 20)
  },
  //前往设置页面
  setting:function(){
    wx.navigateTo({
      url: '/pages/setting/setting',
    })
  }
})